
$(function(){
	gridInit1();
	gridInit2();
});
//第一个表格初始化
function gridInit1(){
	var fdata_html = "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='1' class='text'>";
	var top_html = "延川南产气井";
	    $("#top").html(top_html);
	    
	var ftype_html = "气井数量";
	    $("#f_type").html(ftype_html);
	    fdata_html = fdata_html+"<tr bgcolor='#C1D5ED' style='font-weight:bold;'><td width='40%' height='20' align='center' style='text-align:center;'>区块</td>" +
	    		"<td width='30%' height='20' align='center' style='text-align:center;'>生产井数</td>" +
	    		"<td width='30%' height='20' align='center' style='text-align:center;'>产气井数</td>"+
	    		"</tr>";


	var fdata_temp = "[{fdata:'延1井组_27_20'}," +
			"{fdata:'外围井_19_16'}," +
			"{fdata:'延5井组_30_28'}," +
			"{fdata:'延3井组_36_33'}," +
			"{fdata:'谭坪产建新井_142_3'}," +
			"{fdata:'万宝山产建新井_631_260'}," +
			"{fdata:'合计_889_381'}]";
	var fdata = eval(fdata_temp);//转化为json格式
	$.each(fdata,function(idx,item){
	    if(item != undefined){
	        var fdata_name = item.fdata.split("_")[0];
	        var fdata_sum = item.fdata.split("_")[1];
	        var fdata_sum1 = item.fdata.split("_")[2];
	            fdata_html = fdata_html+"<tr bgcolor='#C1D5ED' onMouseOut=\"mout(this,'#C1D5ED');\" onMouseOver=\"mover(this,'#ffffff');\"><td height='20' align='center' style='padding-left:4px;'>"+fdata_name
	            +"</td><td height='20' align='center' style='padding-right:4px;'>"+fdata_sum
	            +"</td><td height='20' align='center' style='padding-right:4px;'>"+fdata_sum1+"</td></tr>";
	    }
	});
	fdata_html = fdata_html +"</table>";
	$("#data_1").html(fdata_html);
}
//第二个表格初始化
function gridInit2(){
	var fdata_html = "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='1' class='text'>";
	var ftype_html = "气井产量";
	    $("#f_type2").html(ftype_html);
	    fdata_html = fdata_html+"<tr bgcolor='#C1D5ED' style='font-weight:bold;'><td width='40%' height='20' align='center' style='text-align:center;'>区块</td>" +
	    		"<td width='30%' height='20' align='center' style='text-align:center;'>总产量(方/天)</td>" +
	    		"<td width='30%' height='20' align='center' style='text-align:center;'>平均单井(方/天)</td>"+
	    		"</tr>";


	var fdata_temp = "[{fdata:'延1井组_3029_101'}," +
			"{fdata:'外围井_5350_223'}," +
			"{fdata:'延5井组_29080_969'}," +
			"{fdata:'延3井组_31444_873'}," +
			"{fdata:'谭坪产建新井_2537_846'}," +
			"{fdata:'万宝山产建新井_80276_309'}," +
			"{fdata:'合计_161236_420'}]";
	var fdata = eval(fdata_temp);//转化为json格式
	$.each(fdata,function(idx,item){
	    if(item != undefined){
	        var fdata_name = item.fdata.split("_")[0];
	        var fdata_sum = item.fdata.split("_")[1];
	        var fdata_sum1 = item.fdata.split("_")[2];
	            fdata_html = fdata_html+"<tr bgcolor='#C1D5ED' onMouseOut=\"mout(this,'#C1D5ED');\" onMouseOver=\"mover(this,'#ffffff');\"><td height='20' align='center' style='padding-left:4px;'>"+fdata_name
	            +"</td><td height='20' align='center' style='padding-right:4px;'>"+fdata_sum
	            +"</td><td height='20' align='center' style='padding-right:4px;'>"+fdata_sum1+"</td></tr>";
	    }
	});
	fdata_html = fdata_html +"</table>";
	$("#data_2").html(fdata_html);
}

//鼠标特效
function mover(src,clrOver){
    src.bgColor = clrOver;
}
function mout(src,clrout)  {
    src.bgColor = clrout;
}